import React from 'react';
import TextField from 'material-ui/lib/text-field';
import RaisedButton from 'material-ui/lib/raised-button';
import Checkbox from 'material-ui/lib/checkbox';
import ActionFavorite from 'material-ui/lib/svg-icons/action/favorite';
import ActionFavoriteBorder from 'material-ui/lib/svg-icons/action/favorite-border';
const style = {
    margin: 12,
    checkbox: {
        marginBottom: 16,
    }
};

export default React.createClass({
    render: function () {
        const Button = () => (
            <div>
                <RaisedButton label="提交" style={style} secondary={true} onMouseDown={this.props.submit}/>
                <RaisedButton label="退出登录" primary={true} href="/signout" linkButton={true}/>
            </div>
        );
        return (
            <div>
                <form>
                    <TextField
                        hintText="标题"
                        value={this.props.title} onChange={this.props.handleTitle}
                    />
                    <TextField
                        hintText="开始输入"
                        value={this.props.content} onChange={this.props.handleContent}
                        multiLine={true}
                        rows={2}
                        floatingLabelText="请输入文本内容"
                    />
                    <Checkbox
                        checkedIcon={<ActionFavorite />}
                        unCheckedIcon={<ActionFavoriteBorder />}
                        label="是否同意"
                        style={style.checkbox}
                        onCheck={this.props.handleConfirm}
                    />
                    {Button()}
                </form>
            </div>

        );
    }
});